<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>常用指令v-once</title>
</head>
<body>
    <div id="smartParty" >
        <h2 v-once>{{a}}</h2>
        <button @click="add">按我加1</button>
        <button @click="minus">按我减1</button>
    </div>
    <script src="js/vue2.js"></script>
    <script>
        var vue=new Vue({
            el:"#smartParty",
            data:{a:100},
            methods:{
                add() {
                    this.a ++
                    console.log(this.a)
                },
                minus() {
                    this.a --
                    console.log(this.a);
                }
            }
        })
    </script>
</body>
</html>